<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="format-detection" content="telephone=no">
<title>待涨租信息预警</title>
  <th:block th:include="include :: header('H5首页')" />
  <th:block th:include="include :: mobileStatHeader" />
</head>

<body>
<div class="home lists">
  <div class="table">
    <div class="thead">
      <ul>
        <li>
          <p>楼栋</p>
          <p>单元号</p>
          <p>租户名称</p>
          <p>涨租时间</p>
          <p>操作</p>
        </li>
      </ul>
    </div>
    <div class="tbody">
      <div th:each="listNot,higherStat : ${listNot}">
        <ul>
          <li>
            <p th:text="${listNot.buildingName}">楼栋</p>
            <p th:text="${listNot.unitNameStr}">单元号</p>
            <p th:text="${listNot.tenantName}">租户名称</p>
            <p th:text="${#calendars.format(listNot.risePriceFirstTime,'yyyy-MM-dd')}">涨租时间</p>
            <p><a href="javascript:void(0)" class="btn upTenant">确认涨租</a></p>
            <input type="hidden" id="tenantId" name="tenantId" th:value="${listNot.tenantId}">
            <input type="hidden" id="risePriceRatio" name="risePriceRatio" th:value="${listNot.risePriceRatio}">
            <input type="hidden" id="monthlyRentFee" name="monthlyRentFee" th:value="${listNot.monthlyRentFee}">
          </li>
        </ul>
      </div>

    </div>
  </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: mobileStatFooter" />
<script>
  //确认涨租
  $(".upTenant").click(function() {
      var that = $(this);
      $.modal.confirm("确认涨租吗？", function () {
          var tenantId = that.parent().parent().find("input").eq(0).val();
          var risePriceRatio = that.parent().parent().find("input").eq(1).val();
          var monthlyRentFee = that.parent().parent().find("input").eq(2).val();
          var data = new Array();
          data.push({"name": "tenantId", "value": tenantId});
          data.push({"name": "risePriceRatio", "value": risePriceRatio});
          data.push({"name": "monthlyRentFee", "value": monthlyRentFee});
          $.ajax({
              cache: true,
              type: "POST",
              url: ctx + "system/higher/confirm",
              async: false,
              data: data,
              error: function (request) {
                  $.modal.alertError("系统错误");
              },
              success: function (data) {
                  window.location.reload();
              }

          });
      });
  });


</script>
</body>
</html>
